
using MesGLApp.DAL.MesDB;
using MesGLApp.DAL.RoleDB;
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;

namespace MesGLApp.DAL.RoleDB
{
    public partial class RoleDB : DbContext
    {
        public RoleDB()
            : base("name=RoleDB")
        {
        }

        public virtual DbSet<BaseDeptModel> base_dept { get; set; }
        public virtual DbSet<BaseMenuModel> base_menu { get; set; }
        public virtual DbSet<BaseProgModel> base_prog { get; set; }
        public virtual DbSet<BaseRoleModel> base_role { get; set; }
        public virtual DbSet<BaseRoleMenuModel> base_role_menu { get; set; }
        public virtual DbSet<BaseUserModel> base_user { get; set; }
        public virtual DbSet<BaseUserRoleModel> base_user_role { get; set; }

        public virtual DbSet<OrderCompletion> OrderCompletion { get; set; }

        public virtual DbSet<ProdLine> ProdLine { get; set; }

        public virtual DbSet<StandardUpph> StandardUpph { get; set; }

        public virtual DbSet<RealityUpph> RealityUpph { get; set; }

        public virtual DbSet<StandardQC> StandardQC { get; set; }

        public virtual DbSet<RealityQC> RealityQC { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<BaseDeptModel>()
                .Property(e => e.dept_code)
                .IsUnicode(false);

            modelBuilder.Entity<BaseMenuModel>()
                .Property(e => e.menu_code)
                .IsUnicode(false);

            modelBuilder.Entity<BaseMenuModel>()
                .Property(e => e.url)
                .IsUnicode(false);

            modelBuilder.Entity<BaseMenuModel>()
                .Property(e => e.class_name)
                .IsUnicode(false);

            modelBuilder.Entity<BaseProgModel>()
                .Property(e => e.prog_code)
                .IsUnicode(false);

            modelBuilder.Entity<BaseRoleModel>()
                .Property(e => e.role_code)
                .IsUnicode(false);

            modelBuilder.Entity<BaseUserModel>()
                .Property(e => e.pwd)
                .IsUnicode(false);

            modelBuilder.Entity<BaseUserModel>()
                .Property(e => e.email)
                .IsUnicode(false);

            modelBuilder.Entity<BaseUserModel>()
                .Property(e => e.phone)
                .IsUnicode(false);
        }
    }
}
